

package com.hazelcast.map.impl.operation;

import com.hazelcast.map.impl.MapDataSerializerHook;
import com.hazelcast.spi.impl.operationservice.PartitionAwareOperation;
import com.hazelcast.spi.impl.operationservice.ReadonlyOperation;

public class MapIsEmptyOperation extends MapOperation implements PartitionAwareOperation, ReadonlyOperation {

    private boolean empty;

    public MapIsEmptyOperation(String name) {
        super(name);
    }

    public MapIsEmptyOperation() {
    }

    @Override
    protected void runInternal() {
        empty = recordStore.isEmpty();
    }

    @Override
    public Object getResponse() {
        return empty;
    }

    @Override
    public int getClassId() {
        return MapDataSerializerHook.IS_EMPTY;
    }
}
